package com.xugongzhang.ext;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author X
 * @date 2022/12/12 0:52
 */
@Slf4j
@Component
public class MyApplicationListener implements ApplicationListener<ApplicationEvent> {
    // 当容器中发布此事件之后，此方法触发
    @Override
    public void onApplicationEvent(ApplicationEvent event) {
        log.info("收到事件：{}", event);
    }
}
